Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(KONFLUX-4136): add new reduce step #1969

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

scoheb
Copy link
Contributor

@scoheb scoheb commented Sep 17, 2024

@scoheb scoheb force-pushed the KONFLUX-4136-update-task branch from f666b12 to dcc6954 Compare September 17, 2024 16:43
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.11%. Comparing base (c796ba5) to head (908b47d).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1969   +/-   ##
=======================================
  Coverage   74.11%   74.11%           
=======================================
  Files          88       88           
  Lines        5729     5729           
=======================================
  Hits         4246     4246           
  Misses       1483     1483           
Flag Coverage Δ
generative 74.11% <ø> (ø)
integration 74.11% <ø> (ø)
unit 74.11% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@@ -177,7 +212,7 @@ spec:
- image
- "--verbose"
- "--images"
- "$(params.IMAGES)"
- "$(params.HOMEDIR)/snapshot.json"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be $(params.SNAPSHOT_PATH)?

Also, not sure if we want to expose this as a parameter to the user. It seems more like an implementation detail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for Integration Test Scenarios, SNAPSHOT is the json representation of the snapshot.
for Release Pipelines, SNAPSHOT will be the path to the json file.

With my latest PR #1972 , I am always outputting a JSON file that will either contain the complete Snapshot or the reduced one.

so yes, once that PR merges, I can use $(params.SNAPSHOT_PATH).

It seems more like an implementation detail

Are you meaning to say it should not a param, and I am simply hard-code /tekton/home/snapshot.json?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you meaning to say it should not a param, and I am simply hard-code /tekton/home/snapshot.json?

Yeah, exactly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's minor, but I'd rather reduce the amount of parameters introduced. We can always add it later if there's a need. That's easier than removing a parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed parameter and using the already defined HOME parameter in the arg

type: string
default: "false"

- name: CUSTOM_RESOURCE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name and description of this parameter, and the one below, should reflect that is associated with SINGLE_COMPONENT mode. Consider:

- name: SINGLE_COMPONENT_NAME
  description: >
    Name, including kind, of the Kubernetes resource to query for labels when single
    component mode is enabled, e.g. pr/somepipeline.
- name: SINGLE_COMPONENT_NAMESPACE
  description: >
    Kubernetes namespace where the SINGLE_COMPONENT_NAME is found. Only used 
    when single component mode is enabled.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe SINGLE_COMPONENT_CR and SINGLE_COMPONENT_NS.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ever not a pipeline run? Maybe SINGLE_COMPONENT_PR ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you need to specify the kind, the implication is it might be something other than a PipelineRun. Is that the intention?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have to change it, then I would prefer SINGLE_COMPONENT_CUSTOM_RESOURCE and SINGLE_COMPONENT_CUSTOM_RESOURCE_NAMESPACE

Is it ever not a pipeline run? Maybe SINGLE_COMPONENT_PR ?

Yes in Release Pipelines, it is a Snapshot

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer SINGLE_COMPONENT_CUSTOM_RESOURCE and SINGLE_COMPONENT_CUSTOM_RESOURCE_NAMESPACE

Works for me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's quite long I guess. SINGLE_COMPONENT_CUSTOM_RESOURCE_NS maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am ok with SINGLE_COMPONENT_CUSTOM_RESOURCE and SINGLE_COMPONENT_CUSTOM_RESOURCE_NS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@simonbaird
Copy link
Member

I think the acceptance test failure is legit: unable to parse Snapshot specification from /tekton/home/snapshot.json: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1alpha1.SnapshotSpec

@scoheb
Copy link
Contributor Author

scoheb commented Sep 18, 2024

I think the acceptance test failure is legit: unable to parse Snapshot specification from /tekton/home/snapshot.json: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1alpha1.SnapshotSpec

yes. hence #1972

@scoheb scoheb force-pushed the KONFLUX-4136-update-task branch from 8757e8d to 2fa7e16 Compare September 18, 2024 11:52
@scoheb scoheb requested review from simonbaird and lcarva September 18, 2024 12:14
@lcarva
Copy link
Member

lcarva commented Sep 18, 2024

/ok-to-test

@lcarva
Copy link
Member

lcarva commented Sep 18, 2024

Let's just get the commits organized to better represent the change before merging.

Copy link
Member

@simonbaird simonbaird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, but please do a squash as suggested elsewhere.

- add new step to reduce snapshot for single component mode

Signed-off-by: Scott Hebert <[email protected]>
@scoheb scoheb force-pushed the KONFLUX-4136-update-task branch from 2258b53 to 908b47d Compare September 18, 2024 17:38
@lcarva lcarva merged commit 120ea78 into enterprise-contract:main Sep 18, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants